<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="head.jsp" />
<link rel="stylesheet" type="text/css" href="${path}/css/monitor-item.min.css?" />
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
				<a href="main" title="Go to Home" class="tip-bottom"><i
					class="icon-home"></i> Home</a> <a href="itemMain">Monitor Items</a> 
					<a href="#" class="current">
					   <c:if test="${not empty itemId}">
					         Edit Item
					   </c:if>
					   <c:if test="${itemId == null}">
					         Insert Item
					   </c:if>
					</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i></span>
						<h5>
						  <c:if test="${not empty itemId}">
					         Edit Item
					      </c:if>
					      <c:if test="${itemId == null}">
					         Insert Item
					      </c:if>
					    </h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="doItemAction" name="basic_validate" id="basic_validate" novalidate="novalidate">
								<input type="hidden" name="itemId" value="${itemId}" />
								<div class="control-group">
									  <label class="control-label">应用名称</label>
									  <div class="controls">
									      <select name="appId" id="appId">
										  	<c:forEach items="${app_list}" var="item">
											   <option value="${item.id}" <c:if test="${item.id == itemEntity.appId}">selected="selected"</c:if>> ${item.appName}</option>
										    </c:forEach>
										  </select>
									  </div>
								</div>
								
								<div class="control-group">
									  <label class="control-label">监控项类型</label>
									  <div class="controls">
									      <select name="pluginId" id="pluginId">
											<c:forEach items="${plugin_list}" var="item">
											   <option value="${item.id}" <c:if test="${item.id == itemEntity.pluginId}">selected="selected"</c:if>> ${item.pluginName}</option>
										    </c:forEach>
										  </select>
									  </div>
								</div>
								
								<div class="control-group">
									<label class="control-label">监控项名称</label>
									<div class="controls">
										<input type="text" placeholder="请输入监控项的名称....." name="required" id="itemName" value="${itemEntity.itemName}">
									</div>
								</div>
								
								<div class="control-group">
									<label class="control-label">监控项字段</label>
									<div class="controls">
										<input type="text" placeholder="请输入监控项的字段....." name="itemFiled" id="itemFiled" value="${itemEntity.itemFiled}">
									</div>
								</div>
								
								<c:if test="${not empty itemEntity.itemStatus}">
									<c:if test="${itemEntity.itemStatus == 'off'}">   
								    <div class="control-group">
									  <label class="control-label">生效时间</label>
									  <div class="controls">
									      <select name="effectiveInterval" id="effectiveInterval">
											<option value="3" <c:if test="${itemEntity.effectiveInterval == 3}">selected="selected"</c:if>>3分钟后</option>
											<option value="5" <c:if test="${itemEntity.effectiveInterval == 5}">selected="selected"</c:if>>5分钟后</option>
											<option value="10" <c:if test="${itemEntity.effectiveInterval == 10}">selected="selected"</c:if>>10分钟后</option>
											<option value="15" <c:if test="${itemEntity.effectiveInterval == 15}">selected="selected"</c:if>>15分钟后</option>
										  </select>
									  </div>
								    </div>
								  </c:if>
							    </c:if>
								
								<c:if test="${empty itemEntity.itemStatus}">
								    <div class="control-group">
									  <label class="control-label">生效时间</label>
									  <div class="controls">
									      <select name="effectiveInterval" id="effectiveInterval">
											<option value="3">3分钟后</option>
											<option value="5">5分钟后</option>
											<option value="10">10分钟后</option>
											<option value="15">15分钟后</option>
										  </select>
									  </div>
								    </div>
							    </c:if>
									 
								<div class="control-group">
									<label class="control-label">调度频率</label>
									<div class="controls">
										<input type="text" placeholder="请输入监控项的调度频率....." name="number" id="assignInterval" value="${itemEntity.assignInterval}">
									</div>
								</div>
											
					            <div class="form-actions">
						            <c:if test="${not empty itemId}">
						               <button type="submit" class="btn btn-info">Edit</button>
						            </c:if>
						            <c:if test="${itemId == null}">
						                <button type="submit" class="btn btn-success">Save</button>
		                            </c:if>
		                            <input type="button" name="Button"  value="Cancle" class="btn btn-danger" onClick="javascript:history.back()">
					            </div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<jsp:include page="footer.jsp" />
<script src="${path}/js/monitor-item.min.js"></script>
</body>
</html>